<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>Update Password</title>
</h:head>
<f:view>
	<body>

		<ui:composition template="../includes/template.xhtml">

			<ui:define name="mainbody">
				<center>

					<h:form>


						<p:panel header="Update Password" style="min-height: 550px"
							styleClass="prime_panel">
							<p:growl id="growl" showDetail="true" sticky="false"
								autoUpdate="true" showSummary="false" />
							<p:spacer width="10" />
							<center>
								<table cellpadding="4px" cellspacing="8px">

									<tr>
										<td><h:outputText value="Select User :" /> <h:outputText
												value="*" style="color:red" /></td>
										<td><p:tooltip for="user" showEvent="focus"
												hideEvent="blur" showEffect="clip" hideEffect="explode" />
											<p:autoComplete style="width:250"
												value="#{updatePasswordBean.selectedUser}" id="user"
												completeMethod="#{updatePasswordBean.completeUser}" var="s"
												itemLabel="#{s.name} #{s.email}" itemValue="#{s}"
												converter="#{updatePasswordBean.userConverter}"
												forceSelection="true" required="true"
												requiredMessage="Please select a User" maxResults="5" title="Auto complete inbox">
												<f:ajax execute="@this" event="blur" />
											</p:autoComplete>
										</td>
									</tr>
									<tr>
										<td><h:outputText value="Password :" /> <h:outputText
												value="*" style="color:red" /></td>
										<td><p:password feedback="true" match="password2"
												required="true"
												validatorMessage="Passwords should to be match"
												requiredMessage="Please enter Password" id="password"
												value="#{updatePasswordBean.selectedUser.password}">
												<f:ajax execute="@this" event="blur" />
											</p:password>
										</td>
									</tr>

									<tr>
										<td><h:outputText value="Re-Enter Password :" /> <h:outputText
												value="*" style="color:red" /></td>
										<td><p:password feedback="false" id="password2"
												required="true" requiredMessage="Please re-enter Password">
												<f:ajax execute="@this" event="blur" />
											</p:password>
										</td>
									</tr>
									<tr>
										<td></td>
										<td style="text-align: right"><p:commandButton
												id="submit" value="Done" type="submit" ajax="false"
												action="#{updatePasswordBean.updatePassword}" />
										</td>
									</tr>
								</table>
							</center>
						</p:panel>
					</h:form>
				</center>
			</ui:define>
		</ui:composition>
	</body>
</f:view>
</html>
